<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<%@ include file="/WEB-INF/view/include.jsp"%>
<%@page import="ae.pcfc.etks.online.itworx.ehs.web.constants.GlobalConstants"%>

<form:form modelAttribute="<%=GlobalConstants.OFC_REQUEST_MODEL%>"
	name="createRequest" id="createRequest" method="POST"
	action="client/create.htm" enctype="multipart/form-data">

	<div class="error_msg">
		<spring:bind path="ofcRequestModel.*">
			<c:forEach items="${status.errorMessages}" var="error">
				<c:out value="${error}" />
				<br />
			</c:forEach>
		</spring:bind>
	</div>

	<fieldset>
		<legend>
			<spring:message code="label.request.company.nameeng.label" />
		</legend>
	</fieldset>
	<div class="t_form-left">
		<label> <spring:message code="label.request.company.nameeng" />
		</label>
		<form:input path="companyNameEnglish" name="input" type="text"
			class="t_form-fld-disable" disabled="true" />

		<label><spring:message code="label.request.TradeLicenceNo" />
		</label>

		<form:select path="licenseNumber" class="fm-opt trade_licence"
			onchange="setActivityValue(this);">
			<form:option value="">Select</form:option>
			<form:option value="index1">index1</form:option>
			<form:option value="index2">index2</form:option>
			<form:option value="index3">index3</form:option>
			<form:option value="index4">index4</form:option>
		</form:select>

		<label><spring:message code="label.request.buisnessUnit" /> </label>
		<form:input path="businessUnit" type="text" class="t_form-fld-disable"
			disabled="true" />

		<label> <spring:message code="label.request.mailMail" /> </label>
		<form:input path="mainEmail" type="text" class="t_form-fld-disable"
			disabled="true" />

		<label><spring:message code="label.request.requestedBy" /> </label>
		<form:input type="text" class="t_form-fld" path="requestedBy" />

		<label> <spring:message code="label.request.remarks" /> </label>
		<form:textarea path="remarks" naem="textarea" class="t_address"></form:textarea>

	</div>
	<!--form-left-end-->

	<div class="t_form-right">
		<label> <spring:message code="label.request.company.namearab" />
		</label>
		<form:input path="companyNameArabic" type="text"
			class="t_form-fld-disable" disabled="true" />

		<label><spring:message code="label.request.activity" /> </label>
		<form:input path="activity" type="text" lass="t_form-fld-disable"
			disabled="true" id="activity"/>

		<label><spring:message code="label.request.locations" /><span
			class="t_star"><spring:message code="label.required" /> </span>:</label>
		<form:select name="select" class="fm-opt" path="location">
			<option>Select</option>
		</form:select>

		<label><spring:message code="label.request.bcc" /> </label>
		<form:input path="bcc" type="text" class="t_form-fld" />

		<label> <spring:message code="label.request.optionalMail" />
		</label>
		<form:input type="text" class="t_form-fld" path="optionalMail" />
		<label> <spring:message code="label.request.date" /> </label>
		<form:input path="creationDate" type="text" class="t_form-fld-disable"
			disabled="true" />
	</div>
	<!--form right close-->

	<div class="brk"></div>
	<fieldset>
		<legend>
			<spring:message code="label.request.contactPerson.info" />
		</legend>
	</fieldset>
	<div class="t_form-left">
		<label> <spring:message
				code="label.request.contactPerson.name" /><span class="t_star"><spring:message
					code="label.required" /> </span>:</label>
		<form:input path="contactPersonName" name="input" type="text"
			class="t_form-fld" />


		<label><spring:message
				code="label.request.contactPerson.telephone" /><span class="t_star"><spring:message
					code="label.required" /> </span>:</label>
		<form:input path="telephone" name="input" type="text"
			class="t_form-fld" />


		<label> Fax No.:</label> <input type="text" class="t_form-fld" />
	</div>
	<!--form-left-end-->

	<div class="t_form-right">
		<label> <spring:message
				code="label.request.contactPerson.mobile" /> </label>
		<form:input path="mobile" name="input" type="text" class="t_form-fld" />
		<label> <spring:message
				code="label.request.contactPerson.email" /><span class="t_star"><spring:message
					code="label.required" /> </span>:</label>
		<form:input path="alternativeEmail" name="input" type="text"
			class="t_form-fld" />

	</div>
	<!--form right close-->
	<c:choose>
		<c:when test="${ofcRequestModel.type eq 'Amendment'}">
			<div id="amendment">
				<fieldset>
					<div class="brk"></div>
					<legend>
						<spring:message code="label.request.amendmentType" />
					</legend>
				</fieldset>
				<div class="t_form-left">
					<label><spring:message code="label.request.amendmentType" />
						<span class="t_star"><spring:message code="label.required" />
					</span>:</label>
					<form:select name="select" class="multiple" path="amendmentType"
						multiple="true">
						<form:option value="0" label="Select" />
						<form:options items="${ofcRequestModel.amendmentTypes}"
							itemValue="propertyName" itemLabel="propertyName" />
					</form:select>
				</div>
			</div>
		</c:when>
	</c:choose>

	<c:choose>
		<c:when test="${ofcRequestModel.type eq 'Renewal'}">
			<div id="renewal">
				<fieldset>
					<legend>
						<spring:message code="label.request.imsLogId" />
					</legend>
				</fieldset>
				<div class="t_form-left">
					<label> <spring:message code="label.request.imsLogId" /> <span
						class="t_star"><spring:message code="label.required" /> </span>:</label>
					<form:input type="text" class="t_form-fld" path="imsLogId"/>
				</div>
			</div>
		</c:when>
	</c:choose>
	<div class="brk"></div>
	<fieldset>
		<legend>
			<spring:message code="label.request.documents" />
		</legend>
	</fieldset>

	<div class="t_form-left">
		<label> <spring:message code="label.request.documentType" />
		</label>
		<form:select name="select" class="fm-opt" path="documentTypeId"
			id="documentTypes">
			<form:option value="0" label="Select" />
			<form:options items="${ofcRequestModel.documentTypes}" itemValue="id"
				itemLabel="englishName" />
		</form:select>


	</div>

	<!--form-left-end-->

	<div class="t_form-right">
		<label> <spring:message code="label.request.uploadDocument" />
		</label>
		<form:input type="file" class="t_form-fld" size="10"
			style="width: 138px;" id="file" path="multipartFile" />
		<img src="resources/images/common/upload-btn.png" class="t_btns"
			onclick="submitForm('client/upload.htm');" />


	</div>

	<!--form right close-->
	<div class="brk"></div>
	<table id="Documents" class="grdView">
		<caption>Documents</caption>
		<colgroup>
			<col width="30%" />
			<col width="60%" />
			<col width="10%" />
		</colgroup>
		<tr>
			<th><spring:message code="label.request.document.type" />
			</th>
			<th><spring:message code="label.request.document.name" />
			</th>
			<th><spring:message code="label.request.document.actions" /></th>
		</tr>
		<c:forEach var="document" items="${ofcRequestModel.documents}" varStatus="loopStatus">
			<tr ${loopStatus.index % 2 == 0 ? 'class="grdAltRow"' : ''} id="documentRow">
				<td>${document.documentType.englishName}</td>
				<td>${document.documentName}</td>
				<td class="actions"><a
					href="client/delete.htm?documentName=${document.documentName}">
						<img src="resources/images/common/cancel_doc_icon.png" /> </a></td>
			</tr>
		</c:forEach>
	</table>

	<div class="brk"></div>

	<div id="fm-submit">
		<div class="t_manad-cont">
			<spring:message code="label.request.generalMessage" />
			<span class="t_star"><spring:message code="label.required" />
			</span> are mandatory.
		</div>
  <form:hidden path="type" />
		<input type="image" src="resources/images/common/submit_btn.png"
			alt="Submit button" class="t_btns" value="Submit" />
		<!--<img src="" class="t_btns" alt=""/>
					-->
	</div>
</form:form>